<% provide(:title, "查看文章") %>

<p id="notice"><%= notice %></p>

<div id="article_navigation">
  <ul class="breadcrumb">
    <li>
      <%= link_to "返回文章列表", articles_path %>
    </li>
  </ul>
</div>

<div class="title">
  <span>
    <%= @article.title %>
  </span>
</div>


<div class="info">
  <span>
    作者：<%= @article.user.name %>
  </span>
  <span>
    时间：<%= edit_time(@article) %>
  </span>
<!--  <ul>-->
<!--    <li>作者：<%#= @article.user.name %> </li>-->
<!--    <li>时间：<%#= edit_time(@article) %> </li>-->
<!--  </ul>-->
</div>

<%= (@article.content).html_safe %>

<!--匿名用户不能看到-->
<div id="article_button">
  <% if logged_in? %>
    <%= button_to '修改文章', edit_article_path(article_id: @article.id),
                  :method => :get, class: "btn btn-info" %>

      <%= button_to '删除文章',  @article, :method => :delete, class: "btn btn-danger"%>
  <% end %>
</div>

<p>添加一个评论：</p>
<%= render @article.comments %>

<% if logged_in? %>
  <%= render 'comments/form' %>
<% end %>